import java.io.FileInputStream;
import java.io.IOException;
import java.util.Scanner;

/**
 * Created by dell on 2017/8/7.
 */
public class RedirectIn {
    public static void main(String[] args) throws IOException {
        try (
                FileInputStream fis = new FileInputStream("F:\\IdeaProjects\\IO\\src\\RedirectIn.java");
        ) {
            System.setIn(fis);
            Scanner sc = new Scanner(System.in);
            sc.useDelimiter("\n");
            while (sc.hasNext()) {
                System.out.println("键盘出入的内容：" + sc.next());
            }
            //System.out.println(sc);
        }
    }
}
